﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using KPIS.GERP.GHRMS.DAL;
using KPIS.GERP.GHRMS.MODEL;
using KPIS.GERP.GHRMS.IBLL;

namespace KPIS.GERP.GHRMS.BLL
{
    public class PersonalBLL : IPersonalBLL    {

        private static DataSet dsGrid;

        public DataSet DsGrid
        {
            get
            {
                return dsGrid;
            }
            set
            {
                dsGrid = value;
            }
        }

        public PersonalInfo GetPersonalInfo(Nullable<int> seq)
        {
            PersonalDAL person = new PersonalDAL();

            return person.GetPersonalInfo(seq); 
        }
        public DataSet LoadGridPersonals()
        {
            PersonalDAL person = new PersonalDAL();
            DataSet ds = new DataSet();

            try
            {
                ds = person.LoadGridPersonals();
            }
            catch
            {
                throw new Exception("Load DataGrid Error");
            }
            finally
            {
                person = null;
            }

            return ds;
        }
        public DataSet LoadListPersonals()
        {
            PersonalDAL person = new PersonalDAL();
            DataSet ds = new DataSet();

            try
            {
                ds = person.LoadListPersonals();
            }
            catch
            {
                throw new Exception("Load DataList Error");
            }
            finally
            {
                person = null;
            }

            return ds;
        }
        public void Insert(PersonalInfo personInfo)
        {
            PersonalDAL person = new PersonalDAL();

            try
            {
                person.Insert(personInfo);
            }
            catch
            {
                throw;
            }
        }
        public void Update(PersonalInfo personInfo)
        {
            PersonalDAL person = new PersonalDAL();

            try
            {
                person.Update(personInfo);
            }
            catch
            {
                throw;
            }
        }
        public void Delete(PersonalInfo personInfo)
        {
            PersonalDAL person = new PersonalDAL();

            try
            {
                person.Delete(personInfo);
            }
            catch
            {
                throw;
            }
        }
        
    }
}
